import request from '@/utils/request'
// 下架sku
export const cancelSale = (skuId) => {
  return request.get(`/admin/product/cancelSale/${skuId}`)
}
// 上架sku
export const onSale = (skuId) => {
  return request.get(`/admin/product/onSale/${skuId}`)
}
// 删除某个sku
export const deleteSku = (skuId) => {
  return request.delete(`/admin/product/deleteSku/${skuId}`)
}
// 获取某个spu下面所有的sku列表
export const findBySpuId = (spuId) => {
  return request.get(`/admin/product/findBySpuId/${spuId}`)
}
// 根据某个sku的id来去获取sku的详情数据
export const getById = (skuId) => {
  return request.get(`/admin/product/getSkuById/${skuId}`)
}
// 获取sku列表的分页数据
export const getPageList = (page, limit) => {
  return request.get(`/admin/product/list/${page}/${limit}`)
}
// 添加sku
export const saveSkuInfo = (sku) => {
  return request.post(`/admin/product/saveSkuInfo`, sku)
}
// 获取spu中图片列表
export const getSpuImageList = (spuId) => {
  return request.get(`/admin/product/spuImageList/${spuId}`)
}
// 获取某个spu中销售属性列表
export const getSpuSaleAttrList = (spuId) => {
  return request.get(`/admin/product/spuSaleAttrList/${spuId}`)
}
